# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=cantor
pkgver=22.04.3
pkgrel=0
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by polkit -> kio
# ppc64le blocked by qt5-qtwebengine
arch="all !armhf !s390x !riscv64 !ppc64le"
url="https://edu.kde.org/cantor/"
pkgdesc="KDE Frontend to Mathematical Software "
license="GPL-2.0-or-later"
makedepends="
	analitza-dev
	discount-dev
	extra-cmake-modules
	karchive-dev
	kcompletion-dev
	kconfig-dev
	kcoreaddons-dev
	kcrash-dev
	kdoctools-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	knewstuff-dev
	kparts-dev
	kpty-dev
	ktexteditor-dev
	ktextwidgets-dev
	kxmlgui-dev
	poppler-qt5-dev
	python3-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	qt5-qtwebengine-dev
	qt5-qtxmlpatterns-dev
	samurai
	syntax-highlighting-dev
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/release-service/$pkgver/src/cantor-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
aea0e1c545a05f46dfec8cf6e7d4a55d5d558e5965c2d15a568bcd38d2bb00f6abe184f976b2bbaab896367bb98ef04a1b4fa7c3af0fb30f0e90ad4d5c068a2c  cantor-22.04.3.tar.xz
"
